HBASE-30150 Propagate filter hints through composite filters#8239
Merged
virajjasani merged 5 commits intoMay 16, 2026
Conversation
…ite filters FilterList (AND/OR), SkipFilter, and WhileMatchFilter now delegate getHintForRejectedRow() and getSkipHint() to their sub-filters, using maximal-step merging for AND and minimal-step merging for OR — consistent with the existing getNextCellHint() convention. ColumnRangeFilter and ColumnPrefixFilter gain stateless getSkipHint() implementations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nd strengthen test coverage - Add getSkipHint() to MultipleColumnPrefixFilter so it participates in the structural-skip hint optimization alongside ColumnPrefixFilter and ColumnRangeFilter. - Add unit tests for the all-sub-filters-terminated edge case in both AND and OR FilterList for getHintForRejectedRow and getSkipHint. - Add integration test for MultipleColumnPrefixFilter.getSkipHint with time-range gating. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…HintForRejectedRow - Track which sub-filters actually rejected via filterRowKey() using a boolean[] rejectedByFilterRowKey array (mirrors seekHintFilters pattern). getHintForRejectedRow now only consults sub-filters that individually returned true from filterRowKey, honouring the per-filter contract. - Clarify Filter.java javadoc: OR's null-collapse semantic is now explicitly documented for both getHintForRejectedRow and getSkipHint. - Add unit test proving the contract: a non-rejecting sub-filter that throws IllegalStateException from getHintForRejectedRow is never called. - Add divergent-hint tests (unit + integration) asserting AND correctly returns max when sub-filters hint to different targets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Preserve existing rejection state in addFilterLists via Arrays.copyOf instead of clobbering with a fresh zero array. - Add javadoc on rejectedByFilterRowKey field documenting the reset invariant (cleared only by reset(), callers must invoke between rows). - Update Filter.getHintForRejectedRow javadoc to make AND's per-sub-filter gating visible to filter authors. - Add reset-invariant unit test: reject row1 -> reset -> accept row2 -> assert getHintForRejectedRow returns null (no stale state). - Clarify fixedRejectedRowHintFilter vs rejectingRowHintFilter helper comments for future contributors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…epth - Fix 4 getSkipHint integration tests to compare hint-aware scan against a genuine no-hint baseline (FilterBase wrapper that delegates filterCell but does not override getSkipHint), ensuring the tests would catch a wrong hint that loses data. - Fix testWhileMatchFilterHintDelegation: assert hintCalls==0 since WhileMatchFilter sets filterAllRemaining before getHintForRejectedRow is consulted by the scanner — documenting the short-circuit behavior. - Add Arrays.fill(rejectedByFilterRowKey, false) at the start of filterRowKey() as defense-in-depth against callers that skip reset(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original PR: #8217